import tensorflow as tf
import matplotlib
from matplotlib import pyplot as plt
#导出  3D坐标轴支持
from mpl_toolkits.mplot3d import Axes3D

#通过tf.meshgrid函数可以方便的生成二维网格的采样点坐标，方便可视化等应用场合
x = tf.linspace(-8.,8,100)
y = tf.linspace(-8.,8,100)
x,y = tf.meshgrid(x,y)
z = tf.sqrt(x**2+y**2)
z = tf.sin(z)/z
tf.config.run_functions_eagerly(True)

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

ax.contour3D(x.numpy(),y.numpy(),z.numpy(),50)
plt.show()